﻿@model StockPredictor.Models.UserPreferencesRecordModel

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>

@{
    ViewBag.Title = "Edit My Preferences";
}

<h2>Edit My Preferences</h2>

@using (@Html.BeginForm())
{
    <fieldset>
        <legend>
            Edit My Preferences
        </legend>

       @Html.HiddenFor(model => model.PreferenceId)

       @Html.HiddenFor(model => model.UserId)
        
        <div class="editor-label">
            EPS Percentage (0 - 100)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EpsPrcntg)
            @Html.ValidationMessageFor(model => model.EpsPrcntg)
        </div>
         <div class="editor-label">
            PE Ratio Percentage (0 - 100)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PeRatioPrcntg)
            @Html.ValidationMessageFor(model => model.PeRatioPrcntg)
        </div>       
        <div class="editor-label">
            Notification Frequency (M for Monthly, W for Weekly)
        </div>
        @{
               var items = new SelectList(new[]
                               {
                                   new SelectListItem {Text = "D", Value = "D"},
                                   new SelectListItem {Text = "M", Value = "M"},
                                   new SelectListItem {Text = "W", Value = "W"},
                               }, "Text", "Value");
            }
         <div class="editor-field">
            @Html.DropDownListFor(model => model.NotificationFrequency, @items)
         </div>        
        <div class="editor-label">
            Include Stocks to Buy (Y for Yes, N for No)
        </div>
        @{
               var stocksNotifications = new SelectList(new[]
                               {
                                   new SelectListItem {Text = "Y", Value = "Y"},
                                   new SelectListItem {Text = "N", Value = "N"},                                  
                               }, "Text", "Value");
            }
         <div class="editor-field">
            @Html.DropDownListFor(model => model.NotificationSendStocksToBuy, @stocksNotifications)
         </div>     
        <div class="editor-label">
            Include Stocks To Sell (Y for Yes, N for No)
        </div>
         <div class="editor-field">
            @Html.DropDownListFor(model => model.NotificationSendStocksToSell, @stocksNotifications)
         </div>
        <div hidden="hidden" class="editor-field">
            @Html.EditorFor(model => model.NotificationLastSentTime)
        </div>
        
        <p>
            <input type="submit" value="Edit" />
        </p>
    </fieldset>

}

<div>
    @Html.ActionLink("Back to My UserPreferences", "Index")
</div>